<!doctype html>
<html class="no-js">
<?php include dirname(__FILE__).'/../head.php';?>
<body>
	<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<?php include dirname(__FILE__).'/../header.php';?>

<div class="am-cf admin-main">
		<!-- sidebar start -->
 	<?php include dirname(__FILE__).'/../sidebar.php';?>
  <!-- sidebar end -->

		<!-- content start -->
		<div class="admin-content">
			<div class="am-cf am-padding">
				<div class="am-fl am-cf">
					<strong class="am-text-primary am-text-lg">活动管理</strong> / <small>修改活动</small>
				</div>
			</div>

			<hr />

			<div class="am-g">
				
					<div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
					<form class="am-form am-form-horizontal" method="post" id="changepicForm"
						enctype="multipart/form-data"
						action="<?php echo U('Activity/changeTeachePic')?>">
						<div class="am-panel am-panel-default">
							<div class="am-panel-bd">
								<div class="am-g">
									<div class="am-u-md-4">
										<img class="am-img-circle am-img-thumbnail" id="prew"
											src="<?php echo __ROOT__?>/<?php echo $activity['pic']?>"
											alt="" name="prew" />
									</div>
									<input name="tid_pic" value="<?php echo $activity['id']?>" type="hidden">
									<div class="am-u-md-8">
						                <p>你好，请上传教师头像,这样显得更牛逼！！！ </p>
						                  <div class="am-form-group">
						                    <input type="file" id="pic" name="pic">
						                    <p class="am-form-help">请选择要上传的文件...</p>
						                  </div>
						             </div>
								</div>
								<button type="submit" id="changepic" class="am-btn am-btn-primary">保存修改</button>
							</div>
						</div>
					</form>
				
						<!--         <div class="am-panel am-panel-default"> -->
						<!--           <div class="am-panel-bd"> -->
						<!--             <div class="user-info"> -->
						<!--               <p>等级信息</p> -->
						<!--               <div class="am-progress am-progress-sm"> -->
						<div class="am-progress-bar" style="width: 60%"></div>
						<!--               </div> -->
						<!--               <p class="user-info-order">当前等级：<strong>LV8</strong> 活跃天数：<strong>587</strong> 距离下一级别：<strong>160</strong></p> -->
						<!--             </div> -->
						<!--             <div class="user-info"> -->
						<!--               <p>信用信息</p> -->
						<!--               <div class="am-progress am-progress-sm"> -->
						<div class="am-progress-bar am-progress-bar-success"
							style="width: 80%"></div>
						<!--               </div> -->
						<!--               <p class="user-info-order">信用等级：正常当前 信用积分：<strong>80</strong></p> -->
						<!--             </div> -->
						<!--           </div> -->
						<!--         </div> -->

					</div>
				<form class="am-form am-form-horizontal" method="post"
					enctype="multipart/form-data"
					action="<?php echo U('Activity/updateActivity')?>">	
					<input name="id" value="<?php echo $activity['id']?>" type="hidden">
					<div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
						<div class="am-form-group">
							<label for="name" class="am-u-sm-3 am-form-label">活动名称</label>
							<div class="am-u-sm-5 am-u-end">
								<input type="text" id="name" name="name" placeholder="活动名称"
									value="<?php echo $activity['name']?>"> <small>活动叫什么名字，必须填！！！！！</small>
							</div>
						</div>
						<div class="am-form-group">
							<label for="academy" class="am-u-sm-3 am-form-label">教师名称</label>
							<div class="am-u-sm-9">
					            <div class="am-btn-group" data-am-button>
					            <?php
				          			foreach ($js as $s){
				         		 ?>
					              <label class="am-btn am-btn-default am-btn-xs" name="sl">
					                <input class="school" type="radio" name="teacher" value="<?php echo $s['id'];?>"> <?php echo $s['name']?>
					              </label>
					              <?php }?>
					          </div>
				            </div>
						</div>
						<div class="am-form-group">
							<label for="" class="am-u-sm-3 am-form-label">期数</label>
							<div class="am-u-sm-6 am-u-end">
								<input type="number" id="term" name="term"
									placeholder="期数" value="<?php echo $activity['term']?>" maxlength="15"> <small>示例：只填数字就可以了，不许填数字以外的东西(｡•ˇ‸ˇ•｡)</small>
							</div>
						</div>
						<div class="am-form-group">
			      			<label for="" class="am-u-sm-3 am-form-label">活动时间</label>
			      			<div class="am-u-sm-6 am-u-end">
				    			<input type="text" id="time" name="time"
 value="<?php echo $activity['time']?>"  maxlength="15"> <small>示例:跟着我的队形走,2016.01.01（星期五）o(〃'▽'〃)o星期不写也可以</small>
 							</div>
						</div>
						<div class="am-form-group">
			      			<label for="" class="am-u-sm-3 am-form-label">活动状态</label>
			      			<div class="am-u-sm-6 am-u-end">
				    			<input type="text" id="status" name="status"
 value="<?php echo $activity['status']?>"  maxlength="15"> <small>示例:1是正常2是结束，必须选一个<(￣ˇ￣)/</small>
							</div>
						</div>
						<div class="am-form-group">
			      			<label for="" class="am-u-sm-3 am-form-label">活动补充（选填）</label>
			      			<div class="am-u-sm-6 am-u-end">
				    			<input type="text" id="other1" name="other1"
 value="<?php echo $activity['other1']?>"  maxlength="150"> <small>示例:1.即兴评述注意事项</small>
							</div>
						</div>
						<div class="am-form-group">
			      			<label for="" class="am-u-sm-3 am-form-label">活动补充第二条（选填）</label>
			      			<div class="am-u-sm-6 am-u-end">
				    			<input type="text" id="other2" name="other2"
 value="<?php echo $activity['other2']?>"  maxlength="150"> <small>示例:2.实例讲解评书技巧</small>
							</div>
						</div>
						<div class="am-form-group">
			      			<label for="" class="am-u-sm-3 am-form-label">活动补充第三条（选填）</label>
			      			<div class="am-u-sm-6 am-u-end">
				    			<input type="text" id="other3" name="other3"
 value="<?php echo $activity['other3']?>"  maxlength="151"> <small>示例:3.现场互动环节，嘉宾为大家答疑解惑</small>
							</div>
						</div>
						<div class="am-form-group">
							<label for="description" class="am-u-sm-3 am-form-label">活动描述（选填）</label>
							<div class="am-u-sm-6 am-u-end">
								<input type="text" id="description" name="description"
									placeholder="活动描述" value="<?php echo $activity['description']?>" maxlength="150"> <small>示例：现场互动环节还有嘉宾为大家答疑解惑和实例讲解评书技巧（反正就是总结一段话，不用分条写就对啦）</small>
							</div>
						</div>


						<div class="am-form-group">
							<div class="am-u-sm-9 am-u-sm-push-3">
								<button type="submit" class="am-btn am-btn-primary">保存修改</button>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- content end -->

	</div>

	<a href="#"
		class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

	<footer>
		<hr>
		<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT
			license.</p>
	</footer>

	<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

	<!--[if (gte IE 9)|!(IE)]><!-->
	<script
		src="<?php echo __ROOT__?>/Public/amaze/assets/js/jquery.min.js"></script>
	<!--<![endif]-->
	<script
		src="<?php echo __ROOT__?>/Public/amaze/assets/js/amazeui.min.js"></script>

	<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/app.js"></script>
	<script charset="utf-8"
		src="<?php echo __ROOT__?>/Public/amaze/editor/kindeditor.js"></script>
	<script charset="utf-8"
		src="<?php echo __ROOT__?>/Public/amaze/editor/lang/zh_CN.js"></script>
	<script>
			//实现图片预览
            		 document.querySelector('#pic').addEventListener('change', function(){
            			    var reader = new FileReader();
            			    reader.onload = function(e) {
            			        document.querySelector('#prew').src = e.target.result;
            			    }
            			    reader.readAsDataURL(this.files[0]);
            			});
            		    
</script>
</body>
</html>
